home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / headers / keymap.h < prev    next >
Encoding:
Text File  |  2000-06-23  |  2.0 KB  |  74 lines

  1. /*
  2.     File:        KeyMap.h
  3.  
  4.     Contains:    TKeyMap is a KeyMap utility class.
  5.                   TKeyMap.h contains the header file information for the TKeyMap class construction.
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1992-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24. // Declare label for this header file
  25. #ifndef _KEYMAP_
  26. #define _KEYMAP_
  27.  
  28. #ifndef _DTSCPLUSLIBRARY_
  29. #include "DTSCPlusLibrary.h"
  30. #endif
  31.  
  32. #ifndef __EVENTS__
  33. #include "Events.h"
  34. #endif
  35.  
  36. #ifndef __TOOLUTILS__
  37. #include <ToolUtils.h>
  38. #endif
  39.  
  40.  
  41. // _________________________________________________________________________________________________________ //
  42. //    Class Interface
  43.  
  44. class TKeyMap
  45. // TKeyMap is a utility class for manipulation of the KeyMap information.
  46. {
  47. public:
  48.     //    CONSTRUCTORS & DESTRUCTORS
  49.     TKeyMap();
  50.     virtual~ TKeyMap();
  51.  
  52.     //    MAIN INTERFACES
  53.     virtual Boolean OptionKeyDown();            // test if option key is down
  54.     virtual Boolean CommandKeyDown();            // test if command key is down
  55.     virtual Boolean ShiftKeyDown();                // test if shift key is down
  56.     virtual Boolean IsKeyDown(unsigned short key);// test if any key is down
  57.  
  58.     //    FIELDS
  59. protected:
  60.     KeyMap fKeyMap;                                // caches the keymap structure
  61. };
  62.  
  63.  
  64. #endif _KEYMAP_
  65.  
  66. // _________________________________________________________________________________________________________ //
  67.  
  68.  
  69. /*    Change History (most recent last):
  70.   No            Init.        Date            Comment
  71.   1            khs        9/20/92        New file
  72. */
  73.  
  74.